package com.yc.test;

import com.yc.bean.FoodBean;
import com.yc.dao.FoodDao;

import java.util.List;
import java.util.Random;

public class testFood {
    static Random rm=new Random();
    public static void main(String[] args) {
        String[] reviews = generateRandomReviews(9);

        for (int i = 0; i < 9; i++) {
            int userid=rm.nextInt(9) + 17;
            int star=4;
//            FoodDao.insertReview( userid, 10,reviews[i],"", star);
            FoodDao.insertReplies(567,userid,reviews[i],"");
        }


    }
    private static String[] generateRandomReviews(int count) {
        String[] reviews = new String[count];
        Random random = new Random();

        String[] spicyAdjectives = {"酸酸", "辣辣", "辣味十足的", "浓浓的辣", "微辣的"};
        String[] beefNoodlePhrases = {"酸辣汤", "什么傻逼汤", "破汤", "辣汤", "酸汤"};

        for (int i = 0; i < count; i++) {
            String spicyAdjective = spicyAdjectives[random.nextInt(spicyAdjectives.length)];
            String beefNoodlePhrase = beefNoodlePhrases[random.nextInt(beefNoodlePhrases.length)];

            int length = random.nextInt(31) + 20; // 随机生成20到50之间的字数
            StringBuilder sb = new StringBuilder();

            // 生成评论内容
            sb.append("这碗").append(spicyAdjective).append(beefNoodlePhrase);
            sb.append(", ").append(generateRandomOpinion(random));
            sb.append(", ").append(generateRandomSatisfaction(random));
            sb.append("。");

            reviews[i] = sb.toString();
        }

        return reviews;
    }

    // 生成随机评价意见
    private static String generateRandomOpinion(Random random) {
        String[] opinions = {"味道不错", "很好吃", "口感棒", "很香", "很地道", "味道很正宗","难吃","想吐","yue了"};
        return opinions[random.nextInt(opinions.length)];
    }

    // 生成随机满意度评价
    private static String generateRandomSatisfaction(Random random) {
        String[] satisfactions = {"我是超强人机", "觉得很满意", "很满意", "感觉很不错", "很满足","我是人机","我也不知道我在说什么"};
        return satisfactions[random.nextInt(satisfactions.length)];
    }
}
